﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace emlak
{
    static class snfKontrol
    {
        static public void Bosalt(ref GroupBox grb)
        {

                    foreach (Control c_grp in grb.Controls)
                    {
                        if (c_grp.GetType().ToString() == "System.Windows.Forms.TextBox")
                        {
                            c_grp.Text = "";
                        }
                        else if (c_grp.GetType().ToString() == "System.Windows.Forms.ComboBox")
                        {
                            c_grp.Text = "";
                        }
                        else if (c_grp.GetType().ToString() == "System.Windows.Forms.DateTimePicker")
                        {
                            c_grp.Text = DateTime.Now.ToString();
                        }
                        else if (c_grp.GetType().ToString() == "System.Windows.Forms.Button")
                        {
                            c_grp.Enabled = true;
                            if (c_grp.Name == "btnGuncelle")
                            {
                                c_grp.Enabled = false;
                            }
                            else if (c_grp.Name == "btnSil")
                            {
                                c_grp.Enabled = false;
                            }
                        }
                    }
              
            
        }

        static public void cmbDuzelt(ref ComboBox cmb)
        {
            cmb.Text = cmb.SelectedItem.ToString();
        }
    }
}
